<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=0,user-scalable=0">
[#include "/wap/include/static.html"]
    <link rel="stylesheet" href="${path}/resources/wap/css/me/add.css"/>
</head>
<body>
<!--头部-->
<div id="header"   onclick="window.location.href='${path}/wap/member'" >
    <div class="left">
        <img id="goBack" src="${path}/resources/wap/img/me/blank.png">
    </div>
    <div class="center">
        添加银行卡
    </div>
</div>
<!--提示框-->
<div class="hint">
为了你资金安全，请提供真实信息
</div>
<form method="post" class="layui-form">
<div class="from">
    <div class="option">
        <div class="option-left bank">银&nbsp;行</div>
        <div class="option-right">

            <select name="bank" id="bank" name="khh" lay-ignore >
            [@p2p_banks]
                [#list banks as bank]
                    <option value='${bank.bank_code}'[#if ((bankCard.bank_code)!'')==bank.bank_code]selected="selected"[/#if] >
                    ${bank.bank_name}
                    </option>
                [/#list]
            [/@p2p_banks]
            </select>
        </div>
    </div>
    <div class="option">
        <div class="option-left  card-numbers">银行卡号</div>
        <div class="option-right"><input type="text" placeholder="请输入开户卡号"  id="card" name="bank_cardno" value="${bankCard.bank_cardno}"></div>
    </div>
    <div class="option">
        <div class="option-left  name">支行名</div>
        <div class="option-right"><input type="text" placeholder="请输入开支行名称" id="branch" value="${bankCard.branch}" name="branch"></div>
    </div>
    <div class="option">
        <div class="option-left  name">省</div>
        <div class="option-right"><input type="text" placeholder="请输入省"  id="s_province" value="${bankCard.s_province}" name="s_province"></div>
    </div>
        <div class="option">
            <div class="option-left  name">市</div>
            <div class="option-right"><input type="text" placeholder="请输入市"  id="s_city" value="${bankCard.s_city}" name="s_city"></div>
        </div>
        <div class="option">
            <div class="option-left  name">区</div>
            <div class="option-right"><input type="text" placeholder="请输入区"  id="s_county" value="${bankCard.s_county}" name="s_county"></div>
        </div>
</div>
<div class="button1" lay-submit lay-filter="MainForm" onclick="save()" [#if bankCard??]disabled[/#if]>
    <button>确定</button>
</div>
</form>
</body>
<script>
    layui.use(['form','layer'], function(){
        var form = layui.form(), $=layui.jquery, layer = layui.layer;


    });
    function save(){
        var index = layer.load();
        var bank = $('#bank').val();
        var bank_cardno = $('#card').val();
        var s_province = $('#s_province').val();
        var s_city = $('#s_city').val();
        var s_county = $('#s_county').val();
        var branch = $('#branch').val();
        ajax({
            url:"${path}/member/bank/save",
            data:{
                'bank':bank,
                's_province':s_province,
                's_city':s_city,
                's_county':s_county,
                'branch':branch,
                'bank_cardno':bank_cardno
            },
            success: function(result){

                layer.msg(result.content,function(){  location.reload(); });

            },
            complete:function(){
                layer.close(index);
            }
        });
    }
</script>
</html>